
function Update () {
	//var p : Vector3 = camera.ScreenToWorldPoint (Vector3 (100,100,camera.nearClipPlane));
    //print(p);
   // var target = GameObject.Find("Cube");
    //target.position = p;
   // target.transform.position = p;Physics.Raycast(Camera.main.transform.position,Camera.main.transform.forward,out hit,float.PositiveInfinity)
    //;
    //Gizmos.color = Color.yellow;
    //Gizmos.DrawSphere (p, 0.1);
    
    /*
    var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
	if (Physics.Raycast (ray, 100)) {
	    print ("Hit something");
	    print(ray.GetPoint);
	} else {
		print("Nothing Hit");
	}*/
	
	/*var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
	var hit : RaycastHit;
	if (Physics.Raycast (ray, hit, 100)) {
	    Debug.DrawLine (ray.origin, hit.point);
	    var bob = GameObject.Find("Cube");
	    bob.transform.position = hit.point;
	}*/
	//print(LayerMask.NameToLayer("NoCollide"));
}

function OnDrawGizmosSelected () {
    var p : Vector3 = camera.ScreenToWorldPoint (Vector3 (100,100,camera.nearClipPlane));
    Gizmos.color = Color.yellow;
    Gizmos.DrawSphere (p, 0.1);
}

//Physics.Raycast(Camera.main.transform.position,Camera.main.transform.forward,out hit,float.PositiveInfinity);

function findSomething(){
	print("something!!!!");
	/*var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
	if (Physics.Raycast (ray, 100)) {
	    print ("Hit something");
	}*/
	
	var ray = Camera.main.ScreenPointToRay (Input.mousePosition);
	var hit : RaycastHit;
	if (Physics.Raycast (ray, hit, 100)) {
	    Debug.DrawLine (ray.origin, hit.point);
	    var bob = GameObject.Find("Waypointer");
	    bob.transform.position = hit.point;
	    bob.transform.position.y  = hit.point.y + 1;
	    
	    var jim:GameObject = GameObject.Find("Character");
	    jim.GetComponent("AstarAI").startNewPath(bob.transform.position);
	    
	}
	
}

